<?php

/**
 * confirmacion actions.
 *
 * @package    aceptor
 * @subpackage confirmacion
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class confirmacionActions extends sfActions
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
public function executeIndex(sfWebRequest $request)
{   

    $email          = $request->getParameter('email');
    $token_acount   = $request->getParameter('token');
    $token_platform = "esferadigital";
    $token_platform = md5($token_platform);
  
    $req = sfConfig::get('app_url_practil')."json_servicio_usuario/account_confirmation?";
    $req = $req.'email='.$email."&token_account=".$token_acount."&token_platform=".$token_platform;

    $respuesta = file_get_contents($req);
    $decode = json_decode($respuesta);   
    $codigo_respuesta = $decode->{'code'};


    if($codigo_respuesta=="j-1003"){
         $this->getUser()->setAttribute('ses_confirmacion',true);
         $this->redirect('home/confirmation_response?email='.$email);
        
    }else{
         $this->getUser()->setAttribute('ses_confirmacion',false);
         $this->redirect('home/confirmation_response?email='.$email);
         
    }
   

}


}
